﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PCLawPrototype
{
    public partial class PUMatterFrm : Form
    {
        public PUMatterFrm()
        {
            InitializeComponent();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            NewMatterFrm newMatterFrm = new NewMatterFrm();
            newMatterFrm.Show();
        }

        private void btnEdit_Click(object sender, EventArgs e)
        {
            NewMatterFrm frmMatterClient;
            if (lstMatter.SelectedIndices[0] == 0)
            {
                frmMatterClient = new NewMatterFrm(/*Common.Matter1*/);
            }
            else
            {
                frmMatterClient = new NewMatterFrm(/*Common.Matter2*/);
            }
            frmMatterClient.Show();
        }

        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (lstMatter.SelectedItems.Count != 0)
            {
                foreach (ListViewItem item in lstMatter.SelectedItems)
                {
                    lstMatter.Items.Remove(item);            
                }
            }
            else
            {
                MessageBox.Show("Please choose at least 1 matter to delete");
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Data Tranferred to caller!");
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnHelp_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Help will be shown!");
        }
    }
}
